
#ifndef SYSMSGTREE_H
#define SYSMSGTREE_H

#pragma once
/////////////////////////////////////////////////////////////////////////////
// CSysMsgTree window
#include "SysMsgData.h"
class CSysMsgTree : public CTreeCtrl
{
// Construction
public:
	CSysMsgTree();
	virtual ~CSysMsgTree();
    void InitTree();
    CSysMsgData myData;
	bool isInited;
    int n_ItemCount;
    int n_Type;
protected:
    int m_space;
    int m_ItemHeight;

public:
    void SysMsg_Open(WPARAM wParam, LPARAM lParam);
protected:
    void On_Dblclk(HTREEITEM hItem);
    void DrawBack(CDC *pDC,int nItemState,CRect rect);
    void DrawFocusRect(CDC* pDC,LPCRECT lpRect);
    void DrawBmp(CDC *pDC,HTREEITEM hTreeItem,CRect rect,int flash);
    void DrawText(CDC *pDC,HTREEITEM hTreeItem,CRect rect);

    INT SortItem(HTREEITEM hItem);
	// Generated message map functions
protected:
    COLORREF crBkColor;
    COLORREF crTextColor;
	//{{AFX_MSG(CSysMsgTree)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

#endif // SYSMSGTREE_H
